Another program I made because all the others like it have some features that are useful, but none have all the features in one app. This is your basic search–all–files–in–a–folder–for–a–string app, except it allows you to store commonly–used directories. It also has a bunch of helpful options. The main reason I wrote File Safari was to have a quick and simple utility for finding function prototypes and #defines in .h files; a program without a bunch of useless memory– and disk–wasting junk like fancy graphics and sounds; a program with one well–defined purpose, not a do–all file locator (System 7.5 already has that).
File Safari supports Balloon Help in all menus and dialogs. If the Balloon Help isn’t enough, read the rest of this file (use TeachText or SimpleText because it contains PICT’s and styled text).
Yes, the main window is a modeless dialog. I don’t care if I’m violating a few HIG’s—it looks cool.
This program was first named “Jonny Quest”, but someone suggested I change it before Hanna–Barbera’s lawyers got ahold of my skinny neck. “File Safari” keeps the adventurous theme, so I didn’t have to ditch the binoculars. :) Why “The Barney Fife Subconscious Prober Primer”? Because “probe” jumped out of the thesaurus while I was trying to come up with a name and I’m a big Andy Griffith Show fan. Any TAGS fan knows what the The Barney Fife Subconscious Prober Primer is (“Gosh darn you Otis!”). Why two names? I dunno. I’m weird.
I assume no responsibility for lost data due to use or misuse of this program, etc, blah blah blah, yatta yatta yatta. If some hunk of legalese is not mentioned here, assume that it has been implied.
Steve Mills
Armpit Studios VII
2219 Davis St.
Iowa City, IA 52240
MuffinHed@aol.com
MuffinHead on ISCABBS (bbs.isca.uiowa.edu)
On to the program…
First, the menus…
Resource Editor []…
This lets you choose a resource editing application to use for viewing matches found in a file’s resource fork. The name will be placed into the brackets or it will be [none] if you haven’t chosen one yet.
Ask Before Opening Resource Files
If you want to be asked each time you double–click on a resource fork match if you want to use your resource editor, check this menu item. Otherwise, un–check it.
TEXT Editor []…
This lets you choose a default application to view TEXT files. If you don’t choose a default TEXT editor, the application that created the file will be used. The name will be placed into the brackets or it will be [none] if you haven’t chosen one yet.
If for some reason the creator application of a file whose match you double–click can’t accept the Apple® Event to open the file, you will be asked if you would like to open the file with your TEXT Editor instead.
Power users can use the application they’ve set to be their TEXT Editor to open any type of file by Option–double–clicking any file in the results list.
Use TEXT Editor
Turn this on to have your default TEXT editor open the files. Turn it off to use the file’s actual creator.
Save Results…
Use this to save the entire search results to a TEXT file.
Quit
Do I really need to tell you what this does?
Cut, Copy, & Paste
So you can copy and paste strings in and out of the Search String in the main window.
Now the main window…
(On monitors of 640 pixels wide or larger, the window will be 640 wide instead of 512.)
Search String
Type the string you want to search within files for here.
Search Directory
The starting folder or disk where the search will start. All folders within this folder/disk will also be searched, and folders within those folders, etc…
Note that in addition to the methods listed later, you can drag & drop folders or disks onto the File Safari icon in the Finder to use them as the Search Dir.
The little Search Dir popup menu
If you have added directories to this list, you can choose those to be the Search Dir by simply choosing them from this menu. In the following image, the user has chosen a Search Dir by clicking on the Other… button or by drag & dropping a file onto File Safari’s icon in the Finder and selecting a directory. Now the menu looks like this:
As you can see, the top item, Add Current Search Dir, is enabled. By choosing the Add Current Search Dir menu item, the current Search Dir will be added to the end of this menu. If you want to delete one of the entries, hold down the Option key while choosing the item to delete from the menu. It will be deleted.
The Recent Search Dirs menu item stores all Search Dir’s added by the Other… button or by drag & dropping them onto File Safari’s icon in the Finder. This list is maintained until you Quit.
Other…
Click this button to choose your Search Directory.
The Select xxxx button will select the current directory you are within, not the currently hilited folder or disk. If the user hit Return in the above picture, the resulting dialog box would look like the following:
Now hitting Return will select the folder named “PunchClock ƒ” as the Search Dir. Typing Command–S is equivalent to clicking the Select xxxx button so you can select directories from the keyboard when the Select xxxx button isn’t the default button.
Search Options button
This will bring up the following dialog box:
Ignore Case
Turn this on so the case of the Search String is ignored. Example: If the Search String is “lerxt” and Ignore Case is turned ON, then “LERXT”, “Lerxt”, and “lerxt” will all be found. If Ignore Case is turned OFF, only “lerxt” will be found.
Ignore Diacriticals
Turn this on so any characters with a diacritical mark will be converted to the same char without the diacritical. Example: If the Search String is “Äbõtt” and Ignore Diacriticals is turned ON, then “Abott”, “Äbott”, and “Abõtt” will be found. If Ignore Case is turned OFF, only “Äbõtt” will be found. If both Ignore Case and Ignore Diacriticals are turned ON, then “abõtt” and “aBOTT” will also be found.
1st Occurrence Only
If you only want to see the 1st occurrence of a match in each file, turn this on. Otherwise all matches in each file will be shown in the results.
Search Nested Folders
When this option is on, all folders within the Search Dir will be searched recursively. When it’s off, only the files immediately within the Search Dir will be searched.
Data Fork
Turn this on to search the data fork of files. If you don’t know what that means, leave it turned on.
Resource Fork
Turn this on to search the resource fork of files. If you don’t know what that means, turn it OFF.
Detailed Resource Search
When this option is turned on, File Safari will search the resource fork resource–by–resource instead of as one big block. This enables you to see the type and ID of the resource containing the match, as well as the offset of the match within the resource. Using this option will slow the search down quite a bit. Also, you may notice that it shows less matches than the same search with it turned off. This is because the resource map at the end of the resource fork is searched when this option is off, but not when it is on. This option is only available when the Resource Fork option is on.
TEXT Files Only
Turn this on to limit the search to plain ‘TEXT’ files only. If this is turned on, no matches will be found in WriteNow, PageMaker, or M$ Word documents, for example.
Search Type popup menu
This menu controls how the search results are handled.
New Search
This is the default. When you do a search, the search results field will be cleared prior to starting the search.
Append Search to Results
When this type of search is used, subsequent searches will append their results onto the end of the existing search results instead of clearing it.
Search Existing Results
This type of search will clear the results field, but saves file reference data of the results first. It then searches only the files listed in the saved data instead of the normal method of going through the Search Dir. This method is handy for narrowing down a search, e.g.; do New Search for “Andy”, then Search Existing Results for “Barney” will leave you with a list of Andy Griffith scripts in which Anj and Barn both appear in.
Search button
Click this to start the search. This will only be enabled if you have entered a Search String and chosen a Search Dir. Hitting the Return and Enter keys is the same as clicking on this button. After the searched has started, this button will change to Stop. The search can be stopped at any time by typing Escape, Command–. (Command–Period), Return, or Enter.
Hex Search button
Use this button to search for a hexadecimal string instead of an ASCII string. Hex strings can be entered in any of three ways:
C : 0x12EF or 0X12ef
Pascal: $12EF or $12ef
Normal: 12EF or 12ef
You can separate each byte—for example—by spaces if you prefer to make it easier to read:
6d 75 66 66 <—— Search String is “muff”
The Ignore Case option does apply to the resulting string. If Ignore Case is turned on and the previous hex string was searched for, “MUFF”, “Muff”, and “muff” would all be found. Same with Ignore Diacriticals.
The main window will look something like this after a search:
Matches
This shows how many matches were found in how many files out of how many files searched.
The small area below the Matches area
This will show: The current file being searched during a search; The file’s full pathname when you click on a match in the results area; Other stuff.
The larger area below that
This is the search results area. All matches will be displayed here. Click on a match to fully see the file name. Click and hold to get the popup menu containing the file’s Type, Creator, and the offset and the line number at which the match was found, or the resource’s type, ID, and offset if Detailed Resource Search is turned on. Double–click to open the file. If you’re using any of the Metrowerks editors or BBEdit, File Safari also sends a goto–line Apple® Event to bring the line containing the match into view. If you’re using any other editor that supports a goto–line Æ, let me know and I’ll try to add it to the list.
Power users can Option–double–click a match to force their TEXT Editor to open the file, no matter what type the file is or which fork the match was found in.
Command–downArrow and Command–upArrow is the same as clicking the down and up arrows of the scrollbar. Add the Option key to move page–at–a–time.
The triangle
Use this to hide/show the search results info. You can also type Command–Tab to toggle the bottom half of the window.
The following items are stored in the File Safari Pref’s file:
•List of Search Dirs (seen in the Search Dir popup). They appear in the order they’re added to the list.
ResEditor’s can change the order by cutting and pasting the ‘alis’ rez’s.
•Resource Editor.
•State of Ask Before Opening Resource Files menu item.
•TEXT Editor.
•State of Use TEXT Editor menu item.
•Data Fork option.
•Rez Fork option.
•Detailed Resource Search option.
•TEXT Files Only option.
•Ignore Case option.
•Ignore Diacriticals option.
•1st Occurrence Only option.
•Search Nested Folders option.
•The last Search Dir selected from the Search Dir popup menu.
•Window position.
For more info, read the file included in the archive named “Release Note.c”.
This file was edited with another program of mine that I’ll release some day. It can edit styled and colored text, ‘TEXT’ and ‘styl’ resources, and as a result of a tip I got about a publishing company looking for a small editor that could export RTF files, it can export RTF files.